import { createRouter, createWebHistory } from "vue-router";
import Start from "../views/Start.vue";
import Myoption from "../views/main/myoption/Myoption.vue";
// import Home from '@/views/main/Home.vue'
import HealthRcode from "@/views/main/healthRcode/HealthRcode.vue";
import Service from "@/views/main/service/Service.vue";
// import ChangeUser from "@/views/ChangeUser.vue";
import Order from "@/views/main/index/Index.vue";
// import Appointment from "@/views/Appointment .vue";
import LayoutVue from "@/views/Layout.vue";
import IndexVue from "@/views/main/index/Index.vue";


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/layout'
    },
    {
      path: '/layout',
      component: LayoutVue,
      redirect: '/layout/index',
      children: [
        {
          path: 'index',
          component: IndexVue
        },
        {
          path: "service",
          component: Service,
        },
        {
          path: "myoption",
          component: Myoption,
        },
        {
          path: "healthRcode",
          component: HealthRcode,
        },
        {
          path: "order",
          name: "order",
          component: Order,
        },
      ]
    },
    {
      path: '/appointment',
      component: import('@/views/Appointment .vue')
    },
    {
      path: '/start',
      name: "start",
      component: Start
    },

    //   {
    //     path: '/',
    //     redirect: '/home'
    //   },
    //   {

    //     path: '/home',
    //     name: 'home',
    //     component: Home,
    //     redirect: '/home/index',
    //     children: [
    //       {
    //         path: "index",
    //         name: "index",
    //         component: Index,
    //       },
    //       {
    //         path: "myoption",
    //         name: "myoption",
    //         component: Myoption,
    //       },
    //       {
    //         path: "healthRcode",
    //         name: "healthRcode",
    //         component: HealthRcode,
    //       },
    //       {
    //         path: "service",
    //         name: "service",
    //         component: Service,
    //       },
    //       {
    //         path: "order",
    //         name: "order",
    //        component: Order,
    //       },
    //     ],
    //     },
    //     {
    //       path: '/user',
    //       name: 'user',
    //       component:()=>import('@/views/User.vue')
    //     },
    //     {
    //         path: '/changeuser',
    //         name: 'changeuser',
    //         component:ChangeUser,
    //     },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/Login.vue"),
    },
    //   {
    //     path: "/register",
    //     name: "register",
    //     component: () => import("@/views/Register.vue"),
    //   },
    //   {
    //     path: "/idcard",
    //     name: "idcard",
    //     component: () => import("@/views/Idcard.vue"),
    //   }
  ],
});
export default router;
